import React,{useEffect} from 'react'
import Head from './Head'
import './head.css'
import {fixed} from './actionCreators'
import {connect } from 'react-redux'
const Fixed = (props) => {
    let i=0;
    useEffect(() => {
        props.dispatch(fixed());

    },[])
    
   
    return (
        <div>
            <Head/>
            <div className='title'>
                故障报修
            </div>
            <div className='checktable'>
            <table border='1' cellspacing='0'>
                    <tr>
                        <th>排序</th>
                        <th>姓名</th>
                        <th>学号</th>

                        <th>电话</th>
                        
                        <th>报修设备</th>
                        <th>报修数量</th>
                        <th>描述</th>
                        <th>状态</th>
                      
                     
                                      
                    </tr>
                    {props.fixs.map((item)=>{

                        i++;
                        return<tr>
                            <td>{i}</td>
                            <td>{item.Sname} </td>
                            <td>{item.Sno} </td>
                            <td>{item.Tel}</td>
                            <td>{item.Device} </td>
                            <td>{item.Num}</td>
                            <td >{item.Details}</td>
                            <td>已修好</td>
                            
                                                           
                        </tr>
                    })} 
                </table>

            </div>
            
        </div>
    )
}
const mapStateToProps=(state)=>({
   fixs:state.fix.fixs,
  

    
  })
export default connect(mapStateToProps)(Fixed)